﻿using System;
using CI.Misc;
using NUnit.Framework;
using CI;
using CI.Interfaces;

namespace Mesopotamia.UnitTests.Neural
{
    [TestFixture]
    public class IOSynapseValueTests
    {

        private CI.Organism.IOSynapseValue _ioSynapseValue;
        private CI.Organism.Organism _organism;
        private string _bindingName;
        private IHostingEnvironment _hostingEnvironment = new CI.Mesopotamia.MSRBHost(new MockHostingEnvironmentPhysical(), new CI.Mesopotamia.ScenarioLocalXML());
        readonly SimEnv _simEnv = SimEnv.Instance;

        [SetUp]
        public void Setup()
        {
            _organism = new CI.Organism.Organism(_hostingEnvironment);
            _bindingName = CI.Globals.ENERGY;

        }

        /// <summary>This proceedure makes sure the IOSynapes value checks the binding name argument</summary>
        [Test, ExpectedException(typeof(ArgumentException), ExpectedMessage = "BindingName")]
        public void CtorNullBindingNameException()
        {
            this._ioSynapseValue = new CI.Organism.IOSynapseValue(null, 0, _organism, ComparisonType.Equal, Guid.NewGuid());
        }

        /// <summary>This proceedure makes sure the IOSynapes value checks the Organism argument</summary>
        [Test, ExpectedException(typeof(ArgumentException), ExpectedMessage = "Organism")]
        public void CtorNullOrganismException()
        {
            this._ioSynapseValue = new CI.Organism.IOSynapseValue(_bindingName, 0, null, ComparisonType.Equal, Guid.NewGuid());
        }
    }
}
